package com.jml.aop.demo;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;

@Aspect
public class AspectJTest {

	@Pointcut("execution(* *.test(..))")
	public void test(){

	}

	@Before("test()")
	public void beforeTest(){
		System.out.println("方法：beforeTest");
	}

	@After("test()")
	public void afterTest(){
		System.out.println("方法：afterTest");
	}

	@Around("test()")
	public Object aroundTest(ProceedingJoinPoint p) throws Throwable {
		System.out.println("方法：aroundTest开始");
		Object o = null;
		o=p.proceed();
		System.out.println("方法：aroundTest结束");
		return o;
	}

}
